package com.wuxiaofan.product.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wuxiaofan.product.entity.CommentReplay;
import com.wuxiaofan.product.entity.custom.CommentReplayCustom;
import com.wuxiaofan.product.mapper.CommentReplayMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wuxiaofan.product.client.Idgenerator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;

@Service
public class CommentReplayService {
    @Autowired
    private CommentReplayMapper pmsCommentReplayMapper;
    @Resource
    private Idgenerator idgenerator;
    public CommentReplay findById(String id){
        return pmsCommentReplayMapper.selectById(id);
    }

    public CommentReplayCustom findCountByMap(Map paraMap){
        return pmsCommentReplayMapper.findCountByMap(paraMap);
    }

    public CommentReplayCustom findGroupByMap(Map paraMap){
        return pmsCommentReplayMapper.findGroupByMap(paraMap);
    }

    public List<CommentReplayCustom> findByMap(Map paraMap){
        return pmsCommentReplayMapper.findByMap(paraMap);
    }

    public Page<CommentReplayCustom> findByMap(Map paraMap, Page page){
        return page.setRecords(pmsCommentReplayMapper.findByMap(paraMap,page));
    }


    public void updateMapById(Map paraMap){
        pmsCommentReplayMapper.updateMapById(paraMap);
    }
    public void delById(String id){
        pmsCommentReplayMapper.deleteById(id);
    }

    public CommentReplay save(CommentReplay pmsCommentReplay){
        pmsCommentReplay.setId(idgenerator.getId());
        pmsCommentReplayMapper.insert(pmsCommentReplay);
        return pmsCommentReplay;
    }

}
